<?php get_header() ?>

<div class="content-header">
	<ul class="content-header-nav">
		<?php dpa_header_tabs() ?>
	</ul>
</div>

<div id="content">
	<?php do_action( 'template_notices' ) ?>

	<div id="dpa">
		<div id="dpa-graphs">

			<?php if ( dpa_has_categories( array( 'category' => bp_current_action() ) ) ) : ?>
				<?php while ( dpa_achievement_categories() ) : dpa_the_category(); ?>

					<div class="graph fullsize">
						<div class="bar <?php if ( dpa_get_category_percentage() < 100 ) echo ' flatright'; ?>" style="width: <?php dpa_category_percentage() ?>%"></div>
						<div class="caption"><p><?php _e( 'Total Completed: ', 'dpa' ) ?><?php dpa_category_number_unlocked() ?> / <?php dpa_category_number_total() ?></p></div>
					</div>

				<?php endwhile; ?>
			<?php endif; ?>

		</div>

		<?php if ( dpa_has_achievements( array( 'type' => 'unlocked', 'category' => bp_current_action() ) ) ) : ?>
			
			<ul id="dpa-achievementslist">
			<?php while ( dpa_user_achievements() ) : dpa_the_achievement() ?>

				<li class="<?php dpa_is_achievement_unlocked() ?>" id="dpa_<?php dpa_achievement_shortname() ?>">
	
					<?php if ( dpa_get_is_achievement_unlocked() ) : ?>

						<img src="<?php echo WP_PLUGIN_URL ?>/achievements/dp-achievements/images/tick.png" alt="<?php _e( 'This Achievement has been unlocked', 'dpa' ) ?>" />
						<p><span class='dpa-title'><?php dpa_achievement_name() ?></span> - <?php dpa_achievement_description() ?><span class="dpa-timestamp"><?php dpa_achievement_unlocked_date() ?></span></p>

					<?php else: ?>

						<img src="<?php echo WP_PLUGIN_URL ?>/achievements/dp-achievements/images/cross.png" alt="<?php _e( 'This Achievement has not been unlocked', 'dpa' ) ?>" />
						<p><span class='dpa-title'><?php dpa_achievement_name() ?></span> - <?php dpa_achievement_description() ?></p>

					<?php endif; ?>

				</li>

			<?php endwhile; ?>
			</ul>

		<?php endif; ?>

	</div>
</div>

<?php get_footer() ?>